package edu.towson.cis.cosc603.project4.rectangle;

/**
 * The Point Class.
 */
public class Point {

	/** x and y coordinates. */
	public Double x, y;

	/**
	 * Instantiates a new point.
	 *
	 * @param x the x
	 * @param y the y
	 */
	Point(Double x, Double y) {
		this.x = x;
		this.y = y;
	}

	public static Double xDistance(Point point, Point otherPoint) {
		return Math.abs(point.x - otherPoint.x);
	}

	public static Double yDistance(Point point, Point otherPoint) {
		return Math.abs(point.y - otherPoint.y);
	}

	public static Double distanceBetween(Point point, Point otherPoint) {
		return Math.sqrt(Math.pow(xDistance(point, otherPoint), 2) + Math.pow(yDistance(point, otherPoint), 2));
	}
}
